package com.example.saiaadmin.entry;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * 菜单信息表
 *
 *  @author  Vagrant
 * @since 2025/01/13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("eb_system_menu")
public class EbSystemMenu implements Serializable {
    @Serial
    private static final long serialVersionUID = -2954448244459196409L;
    /**
     * 主键
     */

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 父ID
     */
    @TableField(value = "parent_id")
    private Integer parentId;
    /**
     * 组级集合
     */
    @TableField(value = "level")
    private String level;
    /**
     * 菜单名称
     */
    @TableField(value = "name")
    private String name;
    /**
     * 菜单标识代码
     */
    @TableField(value = "code")
    private String code;
    /**
     * 菜单图标
     */
    @TableField(value = "icon")
    private String icon;
    /**
     * 路由地址
     */
    @TableField(value = "route")
    private String route;
    /**
     * 组件路径
     */
    @TableField(value = "component")
    private String component;
    /**
     * 跳转地址
     */
    @TableField(value = "redirect")
    private String redirect;
    /**
     * 是否隐藏 (1是 2否)
     */
    @TableField(value = "is_hidden")
    private Integer isHidden;
    /**
     * 继承layout
     */
    @TableField(value = "is_layout")
    private Integer isLayout;
    /**
     * 菜单类型, (M菜单 B按钮 L链接 I iframe)
     */
    @TableField(value = "type")
    private String type;
    /**
     * 生成id
     */
    @TableField(value = "generate_id")
    private Integer generateId;
    /**
     * 生成key
     */
    @TableField(value = "generate_key")
    private String generateKey;
    /**
     * 状态 (1正常 2停用)
     */
    @TableField(value = "status")
    private Integer status;
    /**
     * 排序
     */
    @TableField(value = "sort")
    private Integer sort;
    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;
    /**
     * 创建者
     */
    @TableField(value = "created_by")
    private Integer createdBy;
    /**
     * 更新者
     */
    @TableField(value = "updated_by")
    private Integer updatedBy;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time")
    private LocalDateTime createTime;
    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time")
    private LocalDateTime updateTime;
    /**
     * 删除时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "delete_ime")
    private LocalDateTime deleteTime;

    @TableField(exist = false)
    private EbSystemMenuMeta meta;

    @TableField(exist = false)
    private List<EbSystemMenu> children;
}